package com.ruoyi.common.core.domain.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.xss.Xss;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;

/**
 * 车辆日志实体类
 *
 * @author yourname
 */
public class CarLog extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Long id;

    /** 租户ID */
    private Integer tenantId;

    /** 车辆ID */
    private Long carId;

    /** 会员ID */
    private String memberId;

    /** 车牌号码 */
    @Xss(message = "车牌号码不能包含脚本字符")
    @NotBlank(message = "车牌号码不能为空")
    @Size(min = 0, max = 20, message = "车牌号码长度不能超过20个字符")
    private String carSn;

    /** 进场时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date inTime;

    /** 出场时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date outTime;

    /** 出场状态（0=未出场，1=已出场） */
    @NotNull(message = "出场状态不能为空")
    private Integer outStatus;

    /** 创建时间 */
    private Date createTime;


    /** 享受优惠（0=未享受，1=已享受） */
//    @NotNull(message = "享受优惠状态不能为空")
    private Integer discountStatus;


    /** 何时打折 */
    private String discountWhen;


    /** 打折信息 */
    private String discountInfo;

    public String getDiscountWhen() {
        return discountWhen;
    }

    public void setDiscountWhen(String discountWhen) {
        this.discountWhen = discountWhen;
    }

    public String getDiscountInfo() {
        return discountInfo;
    }

    public void setDiscountInfo(String discountInfo) {
        this.discountInfo = discountInfo;
    }



    public CarLog() {}

    public CarLog(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Integer getTenantId() {
        return tenantId;
    }

    public void setTenantId(Integer tenantId) {
        this.tenantId = tenantId;
    }

    public Long getCarId() {
        return carId;
    }

    public void setCarId(Long carId) {
        this.carId = carId;
    }

    public String getMemberId() {
        return memberId;
    }

    public void setMemberId(String memberId) {
        this.memberId = memberId;
    }

    public String getCarSn() {
        return carSn;
    }

    public void setCarSn(String carSn) {
        this.carSn = carSn;
    }

    public Date getInTime() {
        return inTime;
    }

    public void setInTime(Date inTime) {
        this.inTime = inTime;
    }

    public Date getOutTime() {
        return outTime;
    }

    public void setOutTime(Date outTime) {
        this.outTime = outTime;
    }

    public Integer getOutStatus() {
        return outStatus;
    }

    public void setOutStatus(Integer outStatus) {
        this.outStatus = outStatus;
    }

    public Integer getDiscountStatus() {
        return discountStatus;
    }

    public void setDiscountStatus(Integer discountStatus) {
        this.discountStatus = discountStatus;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("tenantId", getTenantId())
                .append("carId", getCarId())
                .append("memberId", getMemberId())
                .append("carSn", getCarSn())
                .append("inTime", getInTime())
                .append("outTime", getOutTime())
                .append("outStatus", getOutStatus())
                .append("discountStatus", getDiscountStatus())
                .append("discountWhen", getDiscountWhen())
                .append("discountInfo", getDiscountInfo())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
